#! /bin/sh
#
# susan       This shell script takes care of starting and stopping
#	       the susan File daemon.
#
# chkconfig: 2345 90 9
# description: Backup Archiving REcovery Open Sourced.
#
#

case "$1" in
    'start')
       echo "Starting the Susan File daemon: "
       if test -x @sbindir@/susan-fd && test -f @sysconfidir@/susan-fd.conf; then
          exec  @sbindir@/susan-fd $2 -c @confdir@/susan-fd.conf
       fi
       RETVAL=$?
       echo
       [ $RETVAL -eq 0 ] && touch @subsysdir@/susan-fd
       ;;
    'stop')
       echo "Stopping the Susan File daemon: "
       /sbin/killall -k 10 -TERM @sbindir@/susan-fd
       RETVAL=$?
       echo
       [ $RETVAL -eq 0 ] && rm -f @subsysdir@/susan-fd
       ;;
    'restart')
       $0 stop
       sleep 5
       $0 start
       ;;
    *)
       echo "Usage: $0 {start|stop|restart}"
       exit 1
       ;;
esac
exit 0
